﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace TRON_TheGrid
{
    public class ObjetFixe : Microsoft.Xna.Framework.DrawableGameComponent
    {
        //ATTRIBUTS--------------------------------------------------------------
        private Texture2D texture;    //  sprite textures
        private Vector2 position;     //  sprite position on screen
        private Vector2 size;//  sprite size in pixels
        private SpriteBatch unSpritebatch;

      

        //PROPERTY-------------------------------------------------------------------
        public Texture2D Texture
        {
            get { return texture; }
            set { texture = value; }
        }
        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }
        public Vector2 Size
        {
            get { return size; }
            set { size = value; }
        }
        public SpriteBatch UnSpritebatch
        {
            get { return unSpritebatch; }
            set { unSpritebatch = value; }
        }
      
        //Constructeur------------------------------------------------------------------
        public ObjetFixe(Game game, Texture2D texture, Vector2 position, Vector2 size)
            : base(game)
        {
            this.texture = texture;
            this.position = position;
            this.size = size;
            this.unSpritebatch = new SpriteBatch(game.GraphicsDevice);
        }
        
       
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {


            base.Initialize();
        }

        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {


            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            unSpritebatch.Begin();
            unSpritebatch.Draw(Texture, Position, Color.White);
            unSpritebatch.End();
            base.Draw(gameTime);
         }
    }
}
